package export

import (
	"github.com/lab-online/internal/course/interface/export"
	"github.com/lab-online/internal/shared/valueobject"
)

type Course struct {
	repository Repository
}

func New(repository Repository) export.CourseExport {
	return &Course{repository}
}

func (c *Course) GetCourseByID(ID uint) (valueobject.CourseVO, error) {
	if courseEntity, err := c.repository.GetCourseByID(ID); err != nil {
		return nil, err
	} else {
		return courseEntity, nil
	}
}

func (c *Course) GetExperimentByID(ID uint) (valueobject.ExperimentVO, error) {
	if experimentEntity, err := c.repository.GetExperimentByID(ID); err != nil {
		return nil, err
	} else {
		return experimentEntity, nil
	}
}

func (c *Course) CheckCourseExperimentExists(courseID, experimentID uint) (bool, error) {
	return c.repository.CheckCourseExperimentExists(courseID, experimentID)
}
